﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class DownTimePage : MonoBehaviour
{

    public Text downTimeText;
    private float  downTime;

    public void SetDownTime(float  time)
    {
        downTime = time;
    }

    public float GetDownTime()
    {
        return downTime;
    }


    void Update ()
	{
	    if (downTime > 0)
	    {
            downTime -= Time.deltaTime;

	        if (downTime > 0)
	        {
	            downTimeText.text = Mathf.Floor(downTime).ToString();
	        }
	        else
	        {
	            downTimeText.text = 0.ToString();
	        }         
        }
	}
}
